{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ka8EsSp8YNED"
      },
      "source": [
        "# Дополнительное задание. Библиотека Pandas\n",
        "В этом задании вы проанализируете данные из Appstore\n",
        "\n",
        "<img src=\"https://drive.google.com/uc?export=view&id=1F1Qajgj-dC4o4VI3Wm7fIGlOJA0a60_B\" width=300 height=300>"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Rl48-GqCYNEF"
      },
      "source": [
        "#!pip install pandas"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "fNjo9Tk7YNEI"
      },
      "source": [
        "import pandas as pd\n",
        "import numpy as np"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "1xPaEni5YNEL"
      },
      "source": [
        "### Данные для задания: https://drive.google.com/file/d/1JVVkVH5PysaGwULKZKFRVZTc6n4psAvW/view?usp=sharing\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "my6fQWvBYNEM"
      },
      "source": [
        "data = pd.read_csv('https://drive.google.com/uc?id=1JVVkVH5PysaGwULKZKFRVZTc6n4psAvW')"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Tvo9H9BpYNEN"
      },
      "source": [
        "Посмотрим, что же такое переменная `data`:"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "45ckp1neYNEO",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 423
        },
        "outputId": "2a11a65e-c888-47f0-b3c5-20d7075ab5d3"
      },
      "source": [
        "data"
      ],
      "execution_count": null,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "        User_ID Product_ID Gender    Age  Occupation City_Category  \\\n",
              "0       1000001  P00069042      F   0-17          10             A   \n",
              "1       1000001  P00248942      F   0-17          10             A   \n",
              "2       1000001  P00087842      F   0-17          10             A   \n",
              "3       1000001  P00085442      F   0-17          10             A   \n",
              "4       1000002  P00285442      M    55+          16             C   \n",
              "...         ...        ...    ...    ...         ...           ...   \n",
              "537572  1004737  P00193542      M  36-45          16             C   \n",
              "537573  1004737  P00111142      M  36-45          16             C   \n",
              "537574  1004737  P00345942      M  36-45          16             C   \n",
              "537575  1004737  P00285842      M  36-45          16             C   \n",
              "537576  1004737  P00118242      M  36-45          16             C   \n",
              "\n",
              "       Stay_In_Current_City_Years  Marital_Status  Product_Category_1  \\\n",
              "0                               2               0                   3   \n",
              "1                               2               0                   1   \n",
              "2                               2               0                  12   \n",
              "3                               2               0                  12   \n",
              "4                              4+               0                   8   \n",
              "...                           ...             ...                 ...   \n",
              "537572                          1               0                   1   \n",
              "537573                          1               0                   1   \n",
              "537574                          1               0                   8   \n",
              "537575                          1               0                   5   \n",
              "537576                          1               0                   5   \n",
              "\n",
              "        Product_Category_2  Product_Category_3  Purchase  \n",
              "0                      NaN                 NaN      8370  \n",
              "1                      6.0                14.0     15200  \n",
              "2                      NaN                 NaN      1422  \n",
              "3                     14.0                 NaN      1057  \n",
              "4                      NaN                 NaN      7969  \n",
              "...                    ...                 ...       ...  \n",
              "537572                 2.0                 NaN     11664  \n",
              "537573                15.0                16.0     19196  \n",
              "537574                15.0                 NaN      8043  \n",
              "537575                 NaN                 NaN      7172  \n",
              "537576                 8.0                 NaN      6875  \n",
              "\n",
              "[537577 rows x 12 columns]"
            ],
            "text/html": [
              "\n",
              "  <div id=\"df-f016d511-800e-4235-9023-3a389eca3f6c\" class=\"colab-df-container\">\n",
              "    <div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>User_ID</th>\n",
              "      <th>Product_ID</th>\n",
              "      <th>Gender</th>\n",
              "      <th>Age</th>\n",
              "      <th>Occupation</th>\n",
              "      <th>City_Category</th>\n",
              "      <th>Stay_In_Current_City_Years</th>\n",
              "      <th>Marital_Status</th>\n",
              "      <th>Product_Category_1</th>\n",
              "      <th>Product_Category_2</th>\n",
              "      <th>Product_Category_3</th>\n",
              "      <th>Purchase</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>1000001</td>\n",
              "      <td>P00069042</td>\n",
              "      <td>F</td>\n",
              "      <td>0-17</td>\n",
              "      <td>10</td>\n",
              "      <td>A</td>\n",
              "      <td>2</td>\n",
              "      <td>0</td>\n",
              "      <td>3</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>8370</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>1000001</td>\n",
              "      <td>P00248942</td>\n",
              "      <td>F</td>\n",
              "      <td>0-17</td>\n",
              "      <td>10</td>\n",
              "      <td>A</td>\n",
              "      <td>2</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>6.0</td>\n",
              "      <td>14.0</td>\n",
              "      <td>15200</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>1000001</td>\n",
              "      <td>P00087842</td>\n",
              "      <td>F</td>\n",
              "      <td>0-17</td>\n",
              "      <td>10</td>\n",
              "      <td>A</td>\n",
              "      <td>2</td>\n",
              "      <td>0</td>\n",
              "      <td>12</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>1422</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>1000001</td>\n",
              "      <td>P00085442</td>\n",
              "      <td>F</td>\n",
              "      <td>0-17</td>\n",
              "      <td>10</td>\n",
              "      <td>A</td>\n",
              "      <td>2</td>\n",
              "      <td>0</td>\n",
              "      <td>12</td>\n",
              "      <td>14.0</td>\n",
              "      <td>NaN</td>\n",
              "      <td>1057</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>1000002</td>\n",
              "      <td>P00285442</td>\n",
              "      <td>M</td>\n",
              "      <td>55+</td>\n",
              "      <td>16</td>\n",
              "      <td>C</td>\n",
              "      <td>4+</td>\n",
              "      <td>0</td>\n",
              "      <td>8</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>7969</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>...</th>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "      <td>...</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>537572</th>\n",
              "      <td>1004737</td>\n",
              "      <td>P00193542</td>\n",
              "      <td>M</td>\n",
              "      <td>36-45</td>\n",
              "      <td>16</td>\n",
              "      <td>C</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>2.0</td>\n",
              "      <td>NaN</td>\n",
              "      <td>11664</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>537573</th>\n",
              "      <td>1004737</td>\n",
              "      <td>P00111142</td>\n",
              "      <td>M</td>\n",
              "      <td>36-45</td>\n",
              "      <td>16</td>\n",
              "      <td>C</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>1</td>\n",
              "      <td>15.0</td>\n",
              "      <td>16.0</td>\n",
              "      <td>19196</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>537574</th>\n",
              "      <td>1004737</td>\n",
              "      <td>P00345942</td>\n",
              "      <td>M</td>\n",
              "      <td>36-45</td>\n",
              "      <td>16</td>\n",
              "      <td>C</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>8</td>\n",
              "      <td>15.0</td>\n",
              "      <td>NaN</td>\n",
              "      <td>8043</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>537575</th>\n",
              "      <td>1004737</td>\n",
              "      <td>P00285842</td>\n",
              "      <td>M</td>\n",
              "      <td>36-45</td>\n",
              "      <td>16</td>\n",
              "      <td>C</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>5</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>7172</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>537576</th>\n",
              "      <td>1004737</td>\n",
              "      <td>P00118242</td>\n",
              "      <td>M</td>\n",
              "      <td>36-45</td>\n",
              "      <td>16</td>\n",
              "      <td>C</td>\n",
              "      <td>1</td>\n",
              "      <td>0</td>\n",
              "      <td>5</td>\n",
              "      <td>8.0</td>\n",
              "      <td>NaN</td>\n",
              "      <td>6875</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "<p>537577 rows × 12 columns</p>\n",
              "</div>\n",
              "    <div class=\"colab-df-buttons\">\n",
              "\n",
              "  <div class=\"colab-df-container\">\n",
              "    <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f016d511-800e-4235-9023-3a389eca3f6c')\"\n",
              "            title=\"Convert this dataframe to an interactive table.\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "  <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
              "    <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
              "  </svg>\n",
              "    </button>\n",
              "\n",
              "  <style>\n",
              "    .colab-df-container {\n",
              "      display:flex;\n",
              "      gap: 12px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert {\n",
              "      background-color: #E8F0FE;\n",
              "      border: none;\n",
              "      border-radius: 50%;\n",
              "      cursor: pointer;\n",
              "      display: none;\n",
              "      fill: #1967D2;\n",
              "      height: 32px;\n",
              "      padding: 0 0 0 0;\n",
              "      width: 32px;\n",
              "    }\n",
              "\n",
              "    .colab-df-convert:hover {\n",
              "      background-color: #E2EBFA;\n",
              "      box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "      fill: #174EA6;\n",
              "    }\n",
              "\n",
              "    .colab-df-buttons div {\n",
              "      margin-bottom: 4px;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert {\n",
              "      background-color: #3B4455;\n",
              "      fill: #D2E3FC;\n",
              "    }\n",
              "\n",
              "    [theme=dark] .colab-df-convert:hover {\n",
              "      background-color: #434B5C;\n",
              "      box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
              "      filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
              "      fill: #FFFFFF;\n",
              "    }\n",
              "  </style>\n",
              "\n",
              "    <script>\n",
              "      const buttonEl =\n",
              "        document.querySelector('#df-f016d511-800e-4235-9023-3a389eca3f6c button.colab-df-convert');\n",
              "      buttonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "\n",
              "      async function convertToInteractive(key) {\n",
              "        const element = document.querySelector('#df-f016d511-800e-4235-9023-3a389eca3f6c');\n",
              "        const dataTable =\n",
              "          await google.colab.kernel.invokeFunction('convertToInteractive',\n",
              "                                                    [key], {});\n",
              "        if (!dataTable) return;\n",
              "\n",
              "        const docLinkHtml = 'Like what you see? Visit the ' +\n",
              "          '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
              "          + ' to learn more about interactive tables.';\n",
              "        element.innerHTML = '';\n",
              "        dataTable['output_type'] = 'display_data';\n",
              "        await google.colab.output.renderOutput(dataTable, element);\n",
              "        const docLink = document.createElement('div');\n",
              "        docLink.innerHTML = docLinkHtml;\n",
              "        element.appendChild(docLink);\n",
              "      }\n",
              "    </script>\n",
              "  </div>\n",
              "\n",
              "\n",
              "<div id=\"df-0f4f8f77-8fa7-460b-8485-c69841548a93\">\n",
              "  <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-0f4f8f77-8fa7-460b-8485-c69841548a93')\"\n",
              "            title=\"Suggest charts\"\n",
              "            style=\"display:none;\">\n",
              "\n",
              "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
              "     width=\"24px\">\n",
              "    <g>\n",
              "        <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
              "    </g>\n",
              "</svg>\n",
              "  </button>\n",
              "\n",
              "<style>\n",
              "  .colab-df-quickchart {\n",
              "      --bg-color: #E8F0FE;\n",
              "      --fill-color: #1967D2;\n",
              "      --hover-bg-color: #E2EBFA;\n",
              "      --hover-fill-color: #174EA6;\n",
              "      --disabled-fill-color: #AAA;\n",
              "      --disabled-bg-color: #DDD;\n",
              "  }\n",
              "\n",
              "  [theme=dark] .colab-df-quickchart {\n",
              "      --bg-color: #3B4455;\n",
              "      --fill-color: #D2E3FC;\n",
              "      --hover-bg-color: #434B5C;\n",
              "      --hover-fill-color: #FFFFFF;\n",
              "      --disabled-bg-color: #3B4455;\n",
              "      --disabled-fill-color: #666;\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart {\n",
              "    background-color: var(--bg-color);\n",
              "    border: none;\n",
              "    border-radius: 50%;\n",
              "    cursor: pointer;\n",
              "    display: none;\n",
              "    fill: var(--fill-color);\n",
              "    height: 32px;\n",
              "    padding: 0;\n",
              "    width: 32px;\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart:hover {\n",
              "    background-color: var(--hover-bg-color);\n",
              "    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
              "    fill: var(--button-hover-fill-color);\n",
              "  }\n",
              "\n",
              "  .colab-df-quickchart-complete:disabled,\n",
              "  .colab-df-quickchart-complete:disabled:hover {\n",
              "    background-color: var(--disabled-bg-color);\n",
              "    fill: var(--disabled-fill-color);\n",
              "    box-shadow: none;\n",
              "  }\n",
              "\n",
              "  .colab-df-spinner {\n",
              "    border: 2px solid var(--fill-color);\n",
              "    border-color: transparent;\n",
              "    border-bottom-color: var(--fill-color);\n",
              "    animation:\n",
              "      spin 1s steps(1) infinite;\n",
              "  }\n",
              "\n",
              "  @keyframes spin {\n",
              "    0% {\n",
              "      border-color: transparent;\n",
              "      border-bottom-color: var(--fill-color);\n",
              "      border-left-color: var(--fill-color);\n",
              "    }\n",
              "    20% {\n",
              "      border-color: transparent;\n",
              "      border-left-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "    }\n",
              "    30% {\n",
              "      border-color: transparent;\n",
              "      border-left-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "      border-right-color: var(--fill-color);\n",
              "    }\n",
              "    40% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "      border-top-color: var(--fill-color);\n",
              "    }\n",
              "    60% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "    }\n",
              "    80% {\n",
              "      border-color: transparent;\n",
              "      border-right-color: var(--fill-color);\n",
              "      border-bottom-color: var(--fill-color);\n",
              "    }\n",
              "    90% {\n",
              "      border-color: transparent;\n",
              "      border-bottom-color: var(--fill-color);\n",
              "    }\n",
              "  }\n",
              "</style>\n",
              "\n",
              "  <script>\n",
              "    async function quickchart(key) {\n",
              "      const quickchartButtonEl =\n",
              "        document.querySelector('#' + key + ' button');\n",
              "      quickchartButtonEl.disabled = true;  // To prevent multiple clicks.\n",
              "      quickchartButtonEl.classList.add('colab-df-spinner');\n",
              "      try {\n",
              "        const charts = await google.colab.kernel.invokeFunction(\n",
              "            'suggestCharts', [key], {});\n",
              "      } catch (error) {\n",
              "        console.error('Error during call to suggestCharts:', error);\n",
              "      }\n",
              "      quickchartButtonEl.classList.remove('colab-df-spinner');\n",
              "      quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
              "    }\n",
              "    (() => {\n",
              "      let quickchartButtonEl =\n",
              "        document.querySelector('#df-0f4f8f77-8fa7-460b-8485-c69841548a93 button');\n",
              "      quickchartButtonEl.style.display =\n",
              "        google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
              "    })();\n",
              "  </script>\n",
              "</div>\n",
              "    </div>\n",
              "  </div>\n"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "dataframe",
              "variable_name": "data"
            }
          },
          "metadata": {},
          "execution_count": 3
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "8Euq1CYeYNEX"
      },
      "source": [
        "---"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "kwm98nkcYNEY"
      },
      "source": [
        "#### Вопрос"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "sd8GKDI2YNEZ"
      },
      "source": [
        "О чём данные? (Hint: https://www.kaggle.com/sdolezel/black-friday)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "3q3tNGOrYNEa"
      },
      "source": [
        "#### Основное задание (в тесте надо будет вставлять ответы для этих пунктов):"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "--kzTfO2YNEb"
      },
      "source": [
        "*Примечание:* не бойтесь гуглить и заглядывать в \"Полезные ссылки\" для того, чтобы выполнить какие-то задания. Возможно, на семинаре не было какого-то нужного метода, но он находится в поисковике за 2 минуты."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "WXRRMZe7YNEb"
      },
      "source": [
        "## Задание 1\n",
        "Сколько всего половозрастных категорий (наборов данных из столбцов пол и возраст)?  "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "bj7ljslWYNEd"
      },
      "source": [
        "# Ваш код здесь"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "H4UpHEFbYNEf"
      },
      "source": [
        "## Задание 2\n",
        "Сколько строк с женщинами из категории города С с семейным положением категории 0? (речь не об уникальных ID женщин, а о количестве строк)  "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "QvbBZrkpYNEg"
      },
      "source": [
        "# Ваш код здесь"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "PDC06O38YNEi"
      },
      "source": [
        "## Задание 3\n",
        "Сколько мужчин от 36 до 45, потративших (столбец Purchase) больше 15799 (условных единиц, в данном случае)?   (речь не об уникальных ID, а о количестве строк)  "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "T2_v92xoYNEi"
      },
      "source": [
        "# Ваш код здесь"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "oQNZ-8egYNEm"
      },
      "source": [
        "## Задание 4\n",
        "Сколько строк, в которых NaN'ы находятся одновременно в столбце Product_Category_2 и Product_Category_3?  "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "nwxjErPQYNEn"
      },
      "source": [
        "# Ваш код здесь"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "DxR8KgxBYNEs"
      },
      "source": [
        "## Задание 5\n",
        "Какую долю (вещественное число от 0 до 1, округлить до 4-го знака) от всех покупателей составляют ВМЕСТЕ мужчины от 26 до 35 лет и женщины старше 36 лет (то есть нужно учесть несколько возрастных категорий)? (речь не об уникальных ID, а о количестве таких строк)  "
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ICK0SOJJYNEt"
      },
      "source": [
        "# Ваш код здесь"
      ],
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Задание 6\n",
        "Создайте pandas.DataFrame, отображающий половозрастную структуру покупателей. Столбцы - Age, F И M, в ячейках -  отношение данной категории ко всем пользователям в процентах."
      ],
      "metadata": {
        "id": "512kkffIcmWz"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Ваш код здесь"
      ],
      "metadata": {
        "id": "Ea0lSHfcclRe"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Задание 7 (*)\n",
        "Реализуйте функцию my_std, принимающую на вход pandas.Series (один столбец pandas.Dataframe) и возвращающую стандартное отклонение. Сравните ваш результат и вычисленный с помощью метода describe()."
      ],
      "metadata": {
        "id": "FOwV1Cjed0r5"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "def my_std(input_series):\n",
        "  # Ваш код здесь"
      ],
      "metadata": {
        "id": "v5UQ2zZ1ek3d"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Vv1xTr2YYNEw"
      },
      "source": [
        "---"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ElI6jhXnYNEx"
      },
      "source": [
        "Больше про pandas можно найти по этом полезным ссылкам:"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "itKnSrTFYNEx"
      },
      "source": [
        "* Официальные туториалы: http://pandas.pydata.org/pandas-docs/stable/tutorials.html"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "5anYf9hGYNEy"
      },
      "source": [
        "* Статья на Хабре от [OpenDataScience сообщества](http://ods.ai/)**:** https://habr.com/company/ods/blog/322626/"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "RtVuI14DYNEz"
      },
      "source": [
        "* Подробный гайд: https://media.readthedocs.org/pdf/pandasguide/latest/pandasguide.pdf"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "MySaKecMYNE0"
      },
      "source": [
        "Главное в работе с новыми библиотеками -- не бояться тыкать в разные функции, смотреть типы возвращаемых объектов и активно гуглить, а ещё лучше понимать всё из docstring'а (`Shift+Tab` при нахождении курсора внутри скобок функции)."
      ]
    }
  ]
}